package com.zl.zsk.config;

import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lxb
 * @version 1.0.0
 * @desc:
 * @date 2020-05-27 15:41
 */
@Configuration
public class AliConfig {
    private static volatile boolean STATUS = false;

    private String serverUrl = "https://openapi.alipay.com/gateway.do";
    private String appId = "2021001164638572";
    private String privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCVtmrTW16D65O1HsLQb8JgmbeC3I7N9f8kPBgHrQsi4pbXYIclrvf7pokIlkjWrk9bRKNy8YYuMAwaG2anyQfmpIVSWlQzQ63WZ5DABt695yzovH3UHCrmuEvnsWX2EXKE7txX+fubey1z5GBHe/fYPdktMpJ7qD23bWzZpuDLeQBCzcjviPavBlCMDoWWbzrcgFhlAIDWEFIuuj9rINYQjFHNnaaV4tDFgwG2JcjGWv34pYlbAU3qOBcXAewZkReFX6+lKv3Iq11XNZHQClcrTPnGnNetptZAyw3Xe18YJpCf5SCZZ7w+fhySeMKTUsQIWAnpGTWToqBRE/UAciZ1AgMBAAECggEAS4gEzS1DufqYQsCKOO6pemMTGop74Z1CY92NohHDlI4M3AxvIqvroKKccCCiDu1STBGNBOilcZf8Aw/f8raRreNDABFieZqjkZAej0LoDZccKS8vrFupqU1BvlrZvhN/W2HG+Pu93OuAOv/1MxtwJ0DM2OiyzoBK4sfqKsTulLhplX5PbyCISUwHSeTrK80c/48wQ+3ZOsbS9Z/T4n824XM2dkQOg9Q6JBQLHeXlQxYlW8ZkkYRzAD6EpGZr9rynKBoKOGmFTba23C1VjjhCQ3f8c5+nX8xaHx1UyEFgDXDiDa4c0hIaAa3W3Jt4b9mov0R0XtjHYbZyIcZKw3WUAQKBgQDMozOKbynyGg++r+W+QeM/+IJzKytv4QhQKVYT17EVZZQHcyu7IdX9wkNdQ6vGehp9q1mlYyxH630ErFY2IKsIoBXtf2lpu3djt72wSu2xtALkoHwGKjrbpkb1VG4k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ApXK0z5xpzXrabWQMsN13tfGCaQn+UgmWe8Pn4cknjCk1LECFgJ6Rk1k6KgURP1AHImdQIDAQAB";

    @Bean
    public DefaultAlipayClient defaultAlipayClient(){
        DefaultAlipayClient defaultAlipayClient = new DefaultAlipayClient(serverUrl,appId,privateKey,"json","utf-8",publicKey);
        return defaultAlipayClient;
    }
}
